import html2canvas from 'html2canvas';

export const genHtml2Png = (dom: any) => {
  return new Promise((resolve, reject) => {
    html2canvas(
      dom, 
      {
        height: 400
      }
    ).then(canvas => {
      const imgData = canvas.toDataURL("image/png");
      // 可用于下载、上传、预览等
      // return imgData;
      resolve(imgData)
    });
  })
}